package com.dgut.common.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.*;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author it00zyq
 * @since 2021-04-04
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class Bill implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 标题
     */
    private String title;

    /**
     * 类型，0-支出，1-收入
     */
    private Integer type;

    /**
     * 金额
     */
    private BigDecimal money;

    /**
     * 流水日期
     */
    private Date actualDate;

    /**
     * 标签id
     */
    private Integer tagId;

    /**
     * 用户ID
     */
    private Integer userId;

    /**
     * 1-删除 0-正常
     */
    @TableLogic
    private Integer deleted;

    /**
     * 总收入
     */
    @TableField(exist = false)
    private String sumSpend;

    /**
     * 总支出
     */
    @TableField(exist = false)
    private String sumIncome;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;


}
